package com.lgx.mall.core.service;

import java.util.List;

import com.lgx.common.exception.DataException;
import com.lgx.common.web.Pagination;
import com.lgx.mall.core.entity.Product;

public interface IProductService {
	
	public Product createProduct(Product product)throws DataException;
	public Product updateProduct(Product product)throws DataException;
	public void deleteProduct(Product product)throws DataException;
	public void deleteProduct(long id)throws DataException;
	public Product findProductById(long id);
	
	public List<Product> findProductList(String sql);
	
	public List<Product> findProductList(); 
	
	public Pagination findProductPagination(Object[] params, int pageSize, int pageNum);
	
	public void deleteProducts(String[] ids);
	public List<Product> findProductByCidAndPrice(long categoryId, String type);
	
	public Pagination findProductByCategoryAndPrice(long categoryId, String type, int pageSize, int pageNum);
	public Pagination findProductByCategoryAndPrice2(String areaNode,long categoryId, String type, String sortNumber,int pageSize, int pageNum);
	
	public List<Product> findProductByCidAndPrice2(long categoryId, String type) ;
	
	public List<Product> findProductByIdAndBrand(long id,long brandId);
	
	public List<Product> guessYouLike(int pageSize);
	public List<Product> findProductByNameOrCode(String params);
	public Pagination findProductByNameOrCode(String params,String time,String price,int pageSize, int pageNum);
	public Pagination findProductByBrandName(String params,String time,String price,int pageSize, int pageNum);
	
	/**
	 * 
	 * @param areaNode 同城
	 * @param areaCategory 导航分区
	 * @param categoryId 商品分类
	 * @param brandId 商品品牌
	 * @return
	 */
	public List<Product> findProductByCategory(String areaNode,long areaCategory,long categoryId,long brandId);
	
	public Pagination findProductByCategory(String areaNode,long areaCategory,long categoryId,long brandId,String time,String price, int pageSize, int pageNum);
	
	/**
	 * 修改库存
	 * 
	 * @param productId
	 * @param amount 数量
	 * @param sign + -
	 */
	public void modifyProductInventory(long productId,int amount,String sign);

}
